<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        {{ message }}
    </div>
    <script type="module">
        var name = ''
        var name1 = undefined
        var name2 = null
        var name3 = '7'
        var name4 = {}
        var name5 = 0
        if (name) {
            console.log('1')
        } else {
            console.log('2')
        }
        // Vue
        import Vue from 'https://cdn.jsdelivr.net/npm/vue@2.6.12/dist/vue.esm.browser.js'
        var app = new Vue({
            el: '#app',
            data: {
                message: 'Hello Vue!'
            }
        })
        // const let var
        var a = [];
        for (let i = 0; i < 10; i++) { 
            a[i] = function () {
                console.log(i);
            }; 
        } 
        a[6]();
        a[7]();
        // 
        function fn(){
            // console.log('我草')
            fn()
        }
        // fn()
        function fn1(){ 
            Promise.resolve().then(()=>{
                // console.log('res')
                fn1()
            })
        }
        // fn1()
        function fn2(){ 
            console.log('555')
            setTimeout((res)=>{
                fn2()
            })
        }
        // fn2()
        // 
        var arr = ["A","B","C","D"]
        var arr2 = []
        var obj = {}
        // for(var key in arr){
        //     // var obj = {}
        //     obj.name = arr[key] 
        //     obj.id = key
        //     arr2.push(obj)
        //     obj = {}
        // }
        arr2 = arr.map((res,index,arr)=>{ 
            return {
                id:index,
                name:res
            }
        })
        // console.log(arr2)
        var a = '30%'
        var b = '0.5'
        console.log(parseInt(a),parseInt(b))
    </script>
</body>

</html>